package puzzle.common.imgreader;



public class ImgPattern {
	public final int width;
	public final int height;
	public final int[] pixels;
	public final int threshold;
	public final int priority;
	
	public ImgPattern(int w, int h, int[] pixels, double matchFactor, int prioirty) {
		this.width = w;
		this.height = h;
		this.pixels = pixels;
		this.threshold = (int) (w * h * 0xff * matchFactor);
		this.priority = prioirty;
	}
	
	public String toString() {
		StringBuilder sb = new StringBuilder();
		int i = 0;
		for (int y = 0; y < height; y++) {
			for (int x = 0; x < width; x++) {
				assert (pixels[i] &0xffffff00) == 0;
				sb.append(String.format("%02x", pixels[i++]));
			}
			sb.append("\n");
		}
		return sb.toString();
	}
	
}
